import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppCommonModule } from '@app/shared/common/app-common.module';
import { UtilsModule } from '@shared/utils/utils.module';
import { CountoModule } from 'angular2-counto';
import { ModalModule, TabsModule, TooltipModule, BsDropdownModule, PopoverModule } from 'ngx-bootstrap';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import {
    BsDatepickerModule,
    BsDatepickerConfig,
    BsDaterangepickerConfig,
    BsLocaleService
} from 'ngx-bootstrap/datepicker';
import { NgxBootstrapDatePickerConfigService } from 'assets/ngx-bootstrap/ngx-bootstrap-datepicker-config.service';
import { TableModule } from 'primeng/table';
import {
    CalendarModule,
    TreeModule,
    DragDropModule,
    ContextMenuModule,
    PaginatorModule,
    InputMaskModule,
    EditorModule,
    AutoCompleteModule,
    FileUploadModule,
    CheckboxModule,
    MultiSelectModule
} from 'primeng/primeng';

import { ImageCropperModule } from 'ngx-image-cropper';
import { TextMaskModule } from 'angular2-text-mask';
import { TreeTableModule } from 'primeng/treetable';
import { StockMarketRoutingModule } from './stock-market-routing.module';

//市采物资
import { MarkAccountComponent } from './market/account/mark-account.component';
import { MarkBaseInfoComponent } from './market/base/mark-base-info.component';
import { MarketIntoComponent } from './market/into/market-into.component';
import { CreateOrEditMarketIntoBillItemModalComponent } from './market/into/create-or-edit-market-into-bill-item-modal.component';
import { CreateOrEditMarketIntoBillModalComponent } from './market/into/create-or-edit-market-into-bill-modal.component';
import { MarketBaseInfoModalComponent } from './market/into/market-base-info-modal.component';
import { MarketInventoryComponent } from './market/inventory/market-inventory.component';
import { MarketOutComponent } from './market/out/market-out.component';
import { CreateOrEditMarketOutBillModalComponent } from './market/out/create-or-edit-market-out-bill-item-modal.component';
import { MarketIntoBillItemDetailModalComponent } from './market/into/market-into-bill-item-detail-modal.component';
import { CreateMarketOutOpinionModalComponent } from './market/out/create-or-edit-market-out-opinion-modal.component';
import { MarkBaseFieldComponent } from './market/base/mark-basefield.component';
import { MarkBaseFieldDetailModalComponent } from './market/base/mark-basefield-detail-modal.component';
import { CreateOrEditMarkBaseInfoModalComponent } from './market/base/create-or-edit-mark-baseinfo-modal.component';
import { MarketCancelComponent } from './market/cancel/market-cancel.component';
import { CreateOrEditMarketCancelBillModalComponent } from './market/cancel/create-or-edit-market-cancel-bill-item-modal.component';
import { CreateOrEditMarketReturnBillModalComponent } from './market/return/create-or-edit-market-return-bill-item-modal.component';
import { MarketIntoBillImteModalComponent } from './market/return/market-into-billitem.component';
import { MarketReturnComponent } from './market/return/market-return.component';
NgxBootstrapDatePickerConfigService.registerNgxBootstrapDatePickerLocales();

@NgModule({
    imports: [
        FormsModule,
        CommonModule,
        FileUploadModule,
        ModalModule.forRoot(),
        TabsModule.forRoot(),
        TooltipModule.forRoot(),
        PopoverModule.forRoot(),
        BsDropdownModule.forRoot(),
        BsDatepickerModule.forRoot(),
        StockMarketRoutingModule,
        UtilsModule,
        AppCommonModule,
        TableModule,
        TreeModule,
        DragDropModule,
        ContextMenuModule,
        PaginatorModule,
        AutoCompleteModule,
        EditorModule,
        InputMaskModule,
        NgxChartsModule,
        CountoModule,
        TextMaskModule,
        ImageCropperModule,
        CheckboxModule,
        TreeTableModule,
        CalendarModule,
        MultiSelectModule
    ],
    declarations: [
        //市采物资
        MarkAccountComponent,
        MarkBaseInfoComponent,
        MarketIntoComponent,
        CreateOrEditMarketIntoBillModalComponent,
        CreateOrEditMarketIntoBillItemModalComponent,
        MarketBaseInfoModalComponent,
        MarketInventoryComponent,
        MarketOutComponent,
        CreateOrEditMarketOutBillModalComponent,
        MarketIntoBillItemDetailModalComponent,
        CreateMarketOutOpinionModalComponent,
        MarkBaseFieldComponent,
        MarkBaseFieldDetailModalComponent,
        CreateOrEditMarkBaseInfoModalComponent,
        MarketCancelComponent,
        CreateOrEditMarketCancelBillModalComponent,
        MarketReturnComponent,
        CreateOrEditMarketReturnBillModalComponent,
        MarketIntoBillImteModalComponent,
        
    ],

    providers: [
        {
            provide: BsDatepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerConfig
        },
        {
            provide: BsDaterangepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDaterangepickerConfig
        },
        {
            provide: BsLocaleService,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerLocale
        }
    ]
})
export class StockMarketModule { }
